package com.cbs.android.component.analyse.umeng;

import android.content.Context;

import com.cbs.android.component.application.activity.CBSActivity;
import com.cbs.android.component.application.activity.handler.CBSActivityLifeCyclerHandler;
import com.umeng.analytics.MobclickAgent;

/**
 * Created by broche on 7/18/16.
 */
public class Umeng {
    public static void setDebug(boolean debug) {
        MobclickAgent.setDebugMode(debug);
    }

    public static void init(Context context) {
        CBSActivity.addGlobalResumeHandler(new CBSActivityLifeCyclerHandler() {
            @Override
            public void handler(CBSActivity activity) {
                MobclickAgent.onResume(activity);
            }
        });
        CBSActivity.addGlobalPauseHandler(new CBSActivityLifeCyclerHandler() {
            @Override
            public void handler(CBSActivity activity) {
                MobclickAgent.onPause(activity);
            }
        });
    }
}
